package com.chen.rabbitmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import static com.chen.rabbitmq.config.ConfirmConfig.WARNING_QUEUE_NAME;

/**
 * @author Y·C
 * @version 1.0.0
 * @ClassName WarningConsumer.java
 * @Description 报警消息者
 * @createTime 2023年05月13日 18:41:00
 */
@Component
@Slf4j
public class WarningConsumer {


    @RabbitListener(queues = WARNING_QUEUE_NAME)
    public void receiveWarningMsg(Message message) {
        String msg = new String(message.getBody());
        log.error("报警发现不可路由消息：{}", msg);
    }
}

